/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package genetischeralgorithmus;

/**
 *
 * @author Dominik
 */
public class Parameter {

protected GenetischerAlgorithmusView view;
protected int coding;
protected int selection;
protected int recombination;
protected int mutation;

protected int maxPopulationSize;
protected int maxGeneration;
protected int maxEntityAge;
protected double populationGrowth;
protected int mutationDegree;
protected int startPopulation;
protected double elite;

public Parameter (GenetischerAlgorithmusView view){
    this.view=view;
    this.coding = view.Coding.getSelectedIndex();
    this.selection = view.Selection.getSelectedIndex();
    this.recombination = view.Recombination.getSelectedIndex();
    this.mutation = view.Mutation.getSelectedIndex();

    this.maxPopulationSize = Integer.parseInt(view.MaxPopSize.getText());
    this.maxGeneration = Integer.parseInt(view.MaxGen.getText());
    this.maxEntityAge = Integer.parseInt(view.MaxAge.getText());
    this.populationGrowth =Double.parseDouble(view.PopGrowth.getText());
    this.mutationDegree =Integer.parseInt(view.MutDegree.getText());
    this.startPopulation =Integer.parseInt (view.StartPop.getText());
    this.elite = Double.parseDouble(view.survivors.getText());
}

public int getCoding() {
    return coding;
}

public void setCoding(int coding) {
    this.coding = coding;
}

public int getMaxEntityAge() {
    return maxEntityAge;
}

public void setMaxEntityAge(int maxEntityAge) {
    this.maxEntityAge = maxEntityAge;
}

public int getMaxGeneration() {
    return maxGeneration;
}

public void setMaxGeneration(int maxGeneration) {
    this.maxGeneration = maxGeneration;
}

public int getMaxPopulationSize() {
    return maxPopulationSize;
}

public void setMaxPopulationSize(int maxPopulationSize) {
    this.maxPopulationSize = maxPopulationSize;
}

public int getMutation() {
    return mutation;
}

public void setMutation(int mutation) {
    this.mutation = mutation;
}

public int getMutationDegree() {
    return mutationDegree;
}

public void setMutationDegree(int mutationDegree) {
    this.mutationDegree = mutationDegree;
}

public double getPopulationGrowth() {
    return populationGrowth;
}

public void setPopulationGrowth(double populationGrowth) {
    this.populationGrowth = populationGrowth;
}

public int getRecombination() {
    return recombination;
}

public void setRecombination(int recombination) {
    this.recombination = recombination;
}

public int getSelection() {
    return selection;
}

public void setSelection(int selection) {
    this.selection = selection;
}

public int getStartPopulation() {
    return startPopulation;
}

public void setStartPopulation(int startPopulation) {
    this.startPopulation = startPopulation;
}

public double getElite() {
    return elite;
}

public void setElite(double elite) {
        this.elite = elite;
    }



}
